/*
 * 统计用户输入（4分）
 */

#include <stdio.h>

int main() {
	setbuf(stdout, NULL);

	char input;
	int space = 0, newline = 0, others = 0;

	printf("Please input a string end by #:\n");
	input = getchar();

	while (input != '#') {
		if (input == ' ') {
			++space;
		} else if (input == '\n') {
			++newline;
		} else {
			++others;
		}

		input = getchar();
	}

	printf("space: %d,newline: %d,others: %d\n", space, newline, others);

	return 0;
}